require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 3,["5"] = 5,["6"] = 6,["8"] = 8,["9"] = 8,["10"] = 8,["11"] = 8,["13"] = 8,["14"] = 8,["15"] = 8,["16"] = 8,["18"] = 8,["19"] = 8,["21"] = 8,["24"] = 10,["25"] = 10,["26"] = 10,["27"] = 10,["28"] = 10,["29"] = 10,["30"] = 10,["31"] = 10,["32"] = 12,["33"] = 13,["34"] = 14,["36"] = 16,["38"] = 19,["39"] = 20,["40"] = 21,["42"] = 24,["43"] = 8,["44"] = 8,["45"] = 8,["46"] = 8,["49"] = 27,["50"] = 5,["51"] = 30,["52"] = 31,["54"] = 32,["55"] = 32,["58"] = 33,["59"] = 34,["60"] = 35,["61"] = 36,["62"] = 37,["64"] = 39,["66"] = 41,["67"] = 41,["68"] = 41,["70"] = 41,["71"] = 41,["74"] = 42,["77"] = 45,["78"] = 46,["79"] = 41,["81"] = 41,["82"] = 41,["83"] = 41,["85"] = 41,["87"] = 41,["88"] = 41,["89"] = 41,["90"] = 41,["92"] = 41,["93"] = 41,["96"] = 48,["97"] = 30});
local ____exports = {}
local chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
function ____exports.base64Encode(input)
    local output = ""
    do
        local block = 0
        local charCode = 0
        local idx = 0
        local map = chars
        while true do
            local ____temp_2 = #__TS__StringCharAt(
                input,
                math.floor(idx) | 0
            ) > 0
            if not ____temp_2 then
                map = "="
                ____temp_2 = idx % 1
            end
            if not ____temp_2 then
                break
            end
            local ____string_byte_1 = string.byte
            local ____input_0 = input
            idx = idx + 3 / 4
            charCode = ____string_byte_1(
                string,
                ____input_0,
                math.floor(idx) + 1
            ) or 0
            if math.floor(idx) > #input and charCode == 0 then
                if #output % 4 == 1 then
                    return output .. "="
                end
                return output .. "=="
            end
            if charCode > 255 then
                print("'base64Encode' failed: The string to be encoded contains characters outside of the Latin1 range.")
                return output
            end
            block = block << 8 | charCode
            output = output .. __TS__StringCharAt(
                map,
                math.floor(63 & block >> 8 - idx % 1 * 8)
            )
        end
    end
    return output
end
function ____exports.base64Decode(input)
    local i = #input
    do
        while i > 0 and __TS__StringAccess(input, i) ~= "=" do
            i = i - 1
        end
    end
    local str = __TS__StringSubstr(input, 0, i - 1)
    local output = ""
    if #str % 4 == 1 then
        print("'base64Decode' failed: The string to be decoded is not correctly encoded.")
        return output
    end
    local bs = 0
    do
        local bc = 0
        local buffer
        local idx = 0
        while true do
            buffer = __TS__StringCharAt(str, idx)
            if not buffer then
                break
            end
            if #tostring(buffer) == 0 then
                break
            end
            buffer = (string.find(chars, buffer, nil, true) or 0) - 1
            idx = idx + 1
            local ____temp_5 = ~buffer
            if ____temp_5 then
                local ____temp_3
                if bc % 4 ~= 0 then
                    ____temp_3 = bs * 64 + buffer
                else
                    ____temp_3 = buffer
                end
                bs = ____temp_3
                local ____bc_4 = bc
                bc = ____bc_4 + 1
                ____temp_5 = ____bc_4 % 4 ~= 0
            end
            output = output .. string.char(255 & bs >> (-2 * bc & 6))
            local ____ = ____temp_5 and output or 0
        end
    end
    return output
end
return ____exports
